/*********************************************************************************
 * File name    : aliiot.h
 * Version      : 1.0.0
 * Date         : 2016-09-14
 * Description  : the main function of the aliiot app
 * History      :
 **********************************************************************************/
#ifndef __ALIIOT_H__
#define __ALIIOT_H__

#include <sys/types.h>
#include <sys/socket.h>
#include <sys/un.h>

#define HOST_NAME       "iot.channel.aliyun.com"
#if 0
#define PRODUCT_KEY     "1000072274"
#define PRODUCT_SECRET  "JS8Nftf359ZqlPc0"
#define DEVICE_NAME     "cam1"
#define DEVICE_SECRET   "sNUYNolL34y6TXfM"

#define TOPIC           "/1000072274/topic1"
#else
#define PRODUCT_KEY     "1000055720"
#define PRODUCT_SECRET  "Trbd3yky00RuxzDk"
#define DEVICE_NAME     "arm10"
#define DEVICE_SECRET   "n1bj6JQau9he0fjK"

#define TOPIC           "/1000055720/arm10"
#define TOPIC_SUB       "/1000055720/ling"
#endif

#define MSG_LEN_MAX     (2 * 1024)

#define UNIX_DOMAIN     "/tmp/opendev.domain"

/*******************************************
 * the params of aliyun iot auth
*******************************************/
typedef struct
{
    char product_key[50];
    char product_secret[50];
    char device_name[50];
    char device_secret[50];
    char topic1[50];
    char topic2[50];
} aliyun_iot_auth_param_t;

/*******************************************
 * the struct of opendev_socket
*******************************************/
typedef struct
{
    int                     isready;
    struct sockaddr_un      srv_addr;
    struct sockaddr_un      cli_addr;
    int                     srv_sockfd;
    int                     cli_sockfd;
} opendev_socket_t;


#endif
